package com.hx.base.innerclass;

/**
 * @author jxlgcmh
 * @date 2020-08-16 10:48
 * @description 方法内部类
 */
public class MethodInnerClass {

    private int a = 100;

    public void test(final int param) {
        final String str = "hello";
        class MyMethodInnerClass {
            public void innerMethod() {
                System.out.println("outer a=" + a);
                System.out.println("param=" + param);
                System.out.println("local var=" + str);
            }
        }
        MyMethodInnerClass myMethodInnerClass = new MyMethodInnerClass();
        myMethodInnerClass.innerMethod();
    }

    public static void main(String[] args) {
        MethodInnerClass outer = new MethodInnerClass();
        outer.test(10010);
    }
}
